package org.jeecg.modules.exProject.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.modules.exProject.entity.ExProject;
import org.jeecg.modules.exProject.entity.ExProjectExtend;
import org.jeecg.modules.exProject.mapper.ExProjectExtendMapper;
import org.jeecg.modules.exProject.service.IExProjectExtendService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 项目扩展表
 * @Author: jeecg-boot
 * @Date:   2024-11-19
 * @Version: V1.0
 */
@Service
public class ExProjectExtendServiceImpl extends ServiceImpl<ExProjectExtendMapper, ExProjectExtend> implements IExProjectExtendService {
    @Override
    public ExProjectExtend getExprojectExtend(String projectId) {
        LambdaQueryWrapper<ExProjectExtend> query = new LambdaQueryWrapper<ExProjectExtend>().eq(ExProjectExtend::getProjectId, projectId);
        List<ExProjectExtend> list = this.list(query);
        if(CollectionUtil.isNotEmpty(list)){
            return list.get(0);
        }
        return null;
    }
}
